<!-- INCLUDE cms/output/header_body.html -->

<!-- REQUIRE cms/users/output/option_bar_body.html -->

<section class="full-content">

	<article class="ajax" style="display:none;">&nbsp;</article>
	
	<article>
		<div class="head">User overview</div>
		<div class="content">
		   	<div class="overview">
				<div class="row heading">
					<div style="width: 400px;">Username</div>
					<div style="width: 100px;">Status</div>
					<div style="width: 100px;">Rights</div>
					<div style="width: 80px; text-align:center;">Edit</div>
					<div style="width: 80px; text-align:center;">Delete</div>
				</div>
				<!-- BEGIN users -->
				<div class="row">
					<div style="width: 400px;">{users.USERNAME}</div>
					<div style="width: 100px;">{users.STATUS}</div>
					<div style="width: 100px;">{users.LEVEL}</div>
					<div style="width: 80px; text-align:center;"><a onclick="edit_user({users.ID1})"><input type="button" value="Edit" /></a></div>
					<div style="width: 80px; text-align:center;">
						<!-- IF is_logged_in -->
						<a onclick="delete_user({users.ID2})"><input type="button" value="Delete" /></a>
						<!-- ENDIF -->
					</div>
				</div>
				<!-- END users -->
			</div>
		</div>
	</article>
</section>

<script type="text/javascript">
function edit_user(id)
{
	$('.ajax').load('cms.php?p=users&act=edit&id='+id+'&ajax=true');
	$.blockUI({ 
		message: $('.ajax'),
		css: {
			width: '850px',
			height: '350px',
			padding: '10px',
			margin: 0,
			//left: '16%',
			//top: '25%',
			top:  ($(window).height() - 350) /2 + 'px', 
   			left: ($(window).width() - 850) /2 + 'px', 
			cursor: 'default',
			borderRadius: '10px'
		}
	}); 
}

function delete_user(id)
{
	$('.ajax').load('cms.php?p=users&act=delete&id='+id+'&ajax=true');
	$.blockUI({ 
		message: $('.ajax'),
		css: {
			width: '850px',
			height: '100px',
			padding: '10px',
			margin: 0,
			//left: '16%',
			//top: '25%',
			top:  ($(window).height() - 350) /2 + 'px', 
   			left: ($(window).width() - 850) /2 + 'px', 
			cursor: 'default',
			borderRadius: '10px'
		}
	});
}
</script>

<!-- INCLUDE cms/output/footer_body.html -->